package cn.wolfcode.mapper;

import cn.wolfcode.domain.Permission;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface PermissionMapper {
    int deleteByPrimaryKey(Long id);
    int insert(Permission permission);
    Permission selectByPrimaryKey(Long id);
    List<Permission> selectAll();
    int updateByPrimaryKey(Permission permission);

    // 分页查询
    List<Permission> selectForList(QueryObject qo);

    // 批量插入 要贴注解
    void batchInsert(@Param("permissions") Set<Permission> permissions);

    // 通过角色id查对应的权限
    List<Permission> selectByRoleId(Long roleId);

    // 通过员工id查询 该员工的权限
    List<String> selectExpressionByEmployeeId(Long employeeId);
}